#import <Foundation/Foundation.h>
#import "hello.h"

// compile code
// gcc -o hello hello.m -I /usr/include/GNUstep/ -L /usr/lib/GNUstep/ -lgnustep-base -fconstant-string-class=NSConstantString
//  execute hello
// ./hello

/*
@interface Hello : NSObject {
  NSString *prop;
}

- (NSString *) prop;

- (void) setProp: (NSString *)thatProp;

- (void) hello: (NSString *)name ;

- (void) helloWorld;

@end
*/

@implementation Hello

- (NSString *) prop {
  return prop;
}

- (void) setProp: (NSString *)thatProp{
  [thatProp retain];
  [prop release];
  prop = thatProp;
}

- (void) hello: (NSString *)name {
  NSLog(@"hello,%@ you are right!", name);
}

- (void) helloWorld {
  NSLog(@" hello, world !!!!!1");
}

+ (void) world {
  NSLog(@" it's the world !");
}

- (void)dealloc {
  NSLog(@"release prop");
  [prop release];
  [super dealloc];
}

@end

int main(int argc, char *argv[]){

  Hello *hello = [[Hello alloc] init];
  [hello hello:@"franks woo "];
  [hello helloWorld];
  NSLog(@"%@",[hello prop]);
  [hello setProp: @"haha"];
  NSLog(@"%@",[hello prop]);
  [Hello world];
  //  [hello sayHello];
  [hello release];
    
  return 0;
}

//

